import request from '@/utils/request2'

// 查询内置变量列表
export function listVariable(query) {
  return request({
    url: '/api/variable/list',
    method: 'get',
    params: query
  })
}

// 查询内置变量详细
export function getVariable(id) {
  return request({
    url: '/api/variable/' + id,
    method: 'get'
  })
}

// 新增内置变量
export function addVariable(data) {
  return request({
    url: '/api/variable',
    method: 'post',
    data: data
  })
}

// 修改内置变量
export function updateVariable(data) {
  return request({
    headers: {
      'Content-Type': 'application/json'
    },
    url: '/api/variable/edit',
    method: 'POST',
    data: JSON.stringify(data)
  })
}

// 删除内置变量
export function delVariable(id) {
  return request({
    url: '/api/variable/remove/' + id,
    method: 'GET'
  })
}

// 导出内置变量
export function exportVariable(query) {
  return request({
    url: '/api/variable/export',
    method: 'get',
    params: query
  })
}
